<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
          <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	java.lang.String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>
.left-table .left-table-com tbody tr td,.left-table .left-table-com thead tr th{
	
	background-color: #ffffff;
	color: #000000;

}
</style>
<style>

/* 翻页样式 */
.pagination {  text-align: center; display: block; padding: 15px 0; margin: 0!important;}
.pagination ul { font-size: 0; *word-spacing:-1px/*IE6、7*/; display: inline-block; *display: inline/*IE6,7*/; margin: 0 auto!important; padding: 0; zoom:1;}
.pagination ul li { vertical-align: middle; letter-spacing: normal; word-spacing: normal; display: inline-block; width: auto!important; height: auto!important; padding:0!important; margin: 0 !important; border:none !important;}
.pagination ul li { *display: inline/*IE6,7*/; *float: left; zoom: 1;}
.pagination li span { font-size: 12px; line-height: 24px; color: #AAA; list-style-type: none; background-color: #F5F5F5; display: block; height: 24px; padding: 0px 8px; margin: 0px; border: 1px solid; border-color: #DCDCDC #DCDCDC #B8B8B8 #DCDCDC;}
.pagination li:first-child span { border-radius: 4px 0 0 4px;}
.pagination li:last-child span { border-radius: 0 4px 4px 0;}
.pagination li a span , 
.pagination li a:visited span { color: #333; text-decoration: none; cursor:pointer;}
.pagination li a:hover { text-decoration: none; }
.pagination li a:hover span, 
.pagination li a:active span{ color: #333; background-color: #E8E8E8; border-color: #D0D0D0 #D0D0D0 #AEAEAE #D0D0D0; cursor: pointer;}
.pagination li span.currentpage { color: #FFF; font-weight: bold;  background-color: #41BEDD; border-color: #3AABC6 #3AABC6 #318EA6 #3AABC6; border-radius: 0;}
</style>
</head>
<body>

<div class="research-project">
					<div class="top-title">
						Poster审核
					</div>
					<div class="search-content">
						<div class="left-table" style="width:100%; ">
							
							
							<table border= "1" width= "100%" class="left-table-com">
								<thead>
										
									<tr>
										<th width="10%">序号</th>
										<th width="10%">poster状态</th>
										<th width="30%">poster意见</th>
										<th width="20%">poster名</th>
										<th width="20%">上传时间</th>
										<th width="20%">操作</th>
									</tr>
								</thead>
								<tbody id="c_tbody">
								<c:forEach  items="${list }" var="c" varStatus="h">
								<tr>
									<td>${h.index+1 } </td>
									<c:if test="${c.Accessory_zt =='1' }">
									<td >审批中</td>
									</c:if>
									<c:if test="${c.Accessory_zt =='2' }">
									<td  >拒绝</td>
									</c:if>
									<c:if test="${c.Accessory_zt =='3' }">
									<td >通过</td>
									</c:if>
									<td>${c.Accessory_con }</td>
									<td><a target="_blank" href="/accessory/${c.Accessory_url}">${c.Accessory_name}</a></td>
									<td>${c.addTime }</td>
									<td class="center"> 
									
										<a href="javascript:void(0)" nc_date="${c.user_id }" class="btn-see">查看</a>
										<c:if test="${c.Accessory_zt =='1' }">
											<a href="javascript:void(0)" nc_date="${n.user_id }" acc_id="${c.id}" class="btn-piyue">审批</a>
<%-- 										<a href="javascript:void(0)" nc_date="${n.user_id }" class="btn-del">删除</a> --%>
<%-- 										<a href="javascript:void(0)" nc_date="${n.user_id }" class="btn-del">拒绝</a> --%>
										</c:if>
									</td>
								</tr>
								</c:forEach>
								</tbody>
							</table>
							
							
						</div>
					</div>
				<div class="pagination"></div>
				</div>
				<div class="modal">
				<div class="modal-contant juzhong">
					<div class="contant-title">
						批阅内容
						<i class="close-btn"></i>
						postid:<span id="acc_id"></span>
					</div>
					<div class="contant-body">
						<div class="project-detal">
						</div>
						<div class="detal-list">
							<table border="1" width="100%" >
							<thead>
							</thead>
								<tbody  id="jianm">
									
								</tbody>
							</table>
						</div>
					</div>
				</div>
				
			</div>
		<div style=" height:300px;"></div>
</body>
<script src="<%=path%>/back/js/defined_pagination.js"></script>
<script type="text/javascript">
		$(function(){
			/*分页*/
			eval("page = ${page}");
			eval("size = ${size}");
			eval("total = ${total}"); 
			var clickurl = "/interwar/adminPoster/index.do?page=";
			paging($('.pagination'), page, size, total, clickurl);
			//页面样式调整js代码
			$('.content-part-left dl').click(function(){
				if($(this).find('dd').length==0){
					$(this).find('dt').addClass('removeb')
				}
				$(this).addClass('active').siblings().removeClass('active')
			})
			var oH=$('.content-part-right').height();
			$('.content-part-left').css('height',oH);
			 var trLes = $('.left-table-com tbody tr').length;
			 var listitemle = $('.list-item').length;
			for(var j=0;j<listitemle;j++){
				for(var t=0;t<trLes;t++){
					var trH=$('.left-table-com tbody tr').eq(t).outerHeight();
					$('.table-list .list-item').eq(j).find('span').eq(t+1).css({
						"height":trH,
						"line-height":(trH-14)+'px'
					})
				}
			}
			var tWL= $('.table-list .list-item').length;
			var tblW=0;
			for(var i=0;i<tWL;i++){
				tblW+=$('.table-list .list-item').eq(i).outerWidth()
			}
			$('.table-list').css('width',tblW+10);


			//显示详情内容；
			$(document).on("click", ".btn-piyue", function(){ 
				var id=$(this).attr("acc_id");
				$('#acc_id').html(id);
			 var trHtml='<tr class="tiejiaTr">'
							+'<td><input type="text" name="neirong" ></td>'
							+'<td><a href="javascript:void()" class="tongguo" nc_id="">通过</a></td>'
							+'<td><a href="javascript:void()" class="jujue" nc_id="">拒绝</a></td>'
							+'</tr>'
					$('#jianm').append(trHtml);
				$('.modal').fadeIn();
			});
			
			
			$('.close-btn').click(function(){
				$('.modal').fadeOut();
			})
			
			$(document).on("click", ".tongguo", function(){ 
				var id=$('#acc_id').html();
				var msg = $(this).parent().siblings().eq(0).children().val().trim();
				console.log(id);
				console.log(msg);
				$.post('<%=path%>/admin/tongguo.do', 
		   				{'acc_id':id,'msg':msg},
		   				function(data){
				   			if(data.code=='0'){
				   				//console.log(_this.parent())
				   				alert("审批成功");
				   				window.location.href="<%=path%>/adminPoster/index.do";
				   			}else{
				   				alert(data.msg);
				   			}
		   				}
		   		);
				
			});
			$(document).on("click", ".jujue", function(){ 
				var id=$('#acc_id').html();
				var msg = $(this).parent().siblings().eq(0).children().val().trim();
				console.log(id);
				console.log(msg);
				$.post('<%=path%>/admin/jujue.do', 
		   				{'acc_id':id,'msg':msg},
		   				function(data){
				   			if(data.code=='0'){
				   				//console.log(_this.parent())
				   				alert("审批成功");
				   				window.location.href="<%=path%>/adminPoster/index.do";
				   			}else{
				   				alert(data.msg);
				   			}
		   				}
		   		);
				
			});
			
			
		$('.btn-update').click(function(){
				   		var user_id=$(this).attr('nc_date');
				   		window.location.href="<%=path%>/admin/edit.do?user_id="+user_id;
				   	});
		$('.btn-see').click(function(){
	   		var user_id=$(this).attr('nc_date');
	   		window.location.href="<%=path%>/adminPoster/show.do?user_id="+user_id;
	   	});
		$(document).on("click", ".btn-del", function(){ 
			 if (confirm('确定删除？')) {
			var _this=$(this);
	   		var update_id=$(this).attr('nc_date');
	   		$.post('<%=path%>/admin/del.do', 
	   				{'user_id':user_id},
	   				function(data){
			   			if(data.code=='0'){
			   				//console.log(_this.parent())
			   				_this.parent().parent().remove();
			   			}else{
			   				alert(data.msg);
			   			}
	   				}
	   		);
			 }
	   		//alert(1);
	   	});
	
	    /*
		// 模拟ajax数据用以下方法，方便用户更好的掌握用法
		//参数为当前页
		ajaxTest(1);
		
		function ajaxTest(num) {
			$.ajax({
				url: "table.json",
				type: "get",
				data: {},
				dataType: "json",
				success: function(data) {
					console.log(data);
					//分页
					$("#page").paging({
						pageNo: num,
						totalPage: data.totalPage,
						totalSize: data.totalSize,
						callback: function(num) {
							ajaxTest(num)
						}
					})
				}
			})
		}
		*/

		})

</script>
</html>